Skip to content

Fix #9067: avoid instantiate child parameters to Wildcard if possible #9071

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 1, 2020

Conversation

liufengyun
Copy link
Contributor

Fix #9067: avoid instantiate child parameters to Wildcard if possible

In tests/patmat/i9067.scala, for Foo[X1, X2] <: Base[Any, Any],
X1 and X2 can both be Any instead of Wildcard.
Inferring Wildcard will lead to the signature of Foo.unapply
be inferred as Nothing => Nothing, which causes the checker
to issue a false unexhaustive warning.

…sible

In tests/patmat/i9067.scala, for Foo[X1, X2] <: Base[Any, Any],
X1 and X2 can both be `Any` instead of `Wildcard`.
Inferring `Wildcard` will lead to the signature of `Foo.unapply`
be inferred as `Nothing => Nothing`, which causes the checker
to issue a false unexhaustive warning.
@smarter smarter merged commit 53f95d1 into scala:master Jun 1, 2020
@smarter smarter deleted the fix-9067 branch June 1, 2020 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exhaustivity checking false positive
2 participants